package edu.spec.rxz.week09.class2;

public class Dog extends Animal implements IPet {

    public Dog() {
    }

    public Dog(String name, List sounds, List foods) {
        super(name, sounds, foods);
    }

    @Override
    public void cry() {
        List l = super.getSounds();
        for (int i=0; i<l.size(); i++){
            String s = (String)l.get(i);
            System.out.println(getName() + "叫声是——" + s);
        }
    }

    public static void main(String[] args) {
        List sounds = new ArrayList();
        sounds.add("汪汪1");
        sounds.add("汪汪2");
        sounds.add("汪汪3");
        sounds.add("汪汪4");
        List foods = new ArrayList();
        Dog d = new Dog("嘟嘟", sounds, foods);
        d.cry();
    }

}